package com.zhizuobiao.demo;

import com.zhizuobiao.class2.UserServiceImpl;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

/**
 * spring 整合junit
 */
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = "classpath:spring.xml")
public class SpringJunit {

    @Autowired
    private UserServiceImpl userServiceImpl;

    @Test
    public void springTest(){
        userServiceImpl.showName();
    }
}